package com.company.design.construct.decorator;

/**
 * @author yingfing
 * @create 2020--09--26 0:05
 * @describe
 */
public class Decorator implements Sourceable {
    private Sourceable source;

    public Decorator(Sourceable source) {
        this.source = source;
    }

    @Override
    public void method() {
        before();
        source.method();
        after();
    }

    private void before() {
        System.out.println("before Decorator");
    }

    private void after() {
        System.out.println("after Decorator");
    }
}
